Operators
Generic operators
- class qtealeaves.operators.TNOperators(set_names='default', mapping_func=None)[source]
Generic class to write operators. This class contains no pre-defined operators. It allows you to start from scratch if no other operator class fulfills your needs.
Arguments
- set_nameslist of str, optional
Name of the operators sets. Default to default
- mapping_funccallable (or None), optional
Mapping the site index to an operator. Arguments site_idx must be accepted. Default to None (default mapping to only operator set)
- get_local_links(num_sites, params)[source]
Extract the local links from the operators.
Arguments
- num_sitesinteger
Number of sites.
- paramsdict
Dictionary with parameterization of the simulation.
- get_operator(site_idx_1d, operator_name, params)[source]
Provide a method to return any operator, either defined via a callable or directly as a matrix.
Arguments
- site_idx_1dint, str
If int, site where we need the operator. Mapping will evaluate what to return. If str, name of operator set.
- operator_namestr
Tag/identifier of the operator.
- paramsdict
Simulation parameters as a dictionary; dict is passed to callable.
- property mapping_func
Mapping function for site to operator set name.
- property one_unique
Flag if only one operators set exists (True) or multiple (False).
- property set_names
Return operator set names as list of strings.
- transform(transformation, **kwargs)[source]
Generate a new
TNOperators
by transforming the current instance.Arguments
- transformationcallable
Accepting key and value as arguments plus potential keyword arguments.
- **kwargskey-word arguments
Will be passed to transformation
- write_input(folder_name, params, tensor_backend, required_operators)[source]
Write the input for each operator.
Arguments
- folder_namestr
Folder name with all the input files; will be extended by the subfolder with the operators.
- paramsdict
Dictionary with the simulation parameters.
- tensor_backendinteger
The integer flag indicates if
AbelianSymTensors
orTensors
should be written to the input files.- required_operatorslist
List of operators keys which is needed for AbelianSymTensors, where we distinguish between left, right, center, and independent operators.
- write_operator(folder_dst, operator_name, params, tensor_backend, **kwargs)[source]
Write operator to file. Format depends on the tensor backend.
Arguments
- folder_dststr or filehandle
If filehandle, write there. If string, it defines the folder.
- operator_namestr
Name of the operator.
- paramsdictionary
Contains the simulation parameters.
kwargs : passed to write_symtensor
Spin 1/2 operators
- class qtealeaves.operators.TNSpin12Operators[source]
Operators specifically targeted at spin 1/2 systems. The operators
id
,sx
,sz
,n``= 1/2*(1-``sz
), andnz
= 1/2*(1+``sz``) are provided by default.Arguments
- folder_operatorsstr, optional
The name of the subfolder inside the input folder, where we store operators. Default to
SPIN12
Qudit operators
- class qtealeaves.operators.TN3levelsOperators[source]
Operators defined for Lambda-like three-level systems, e.g., used in the case of Rydberg systems.
Arguments
- folder_operatorsstr, optional
The name of the subfolder inside the input folder, where we store operators. Default to
3levels
Details
The three levels are labeled as: |0>, |1> and |r>. The following operators are defined:
n0
,n1
,nr
,sx01
,sy01
,sz01
,n01
,n10
,n1r
,nr1
,sx1r
. The identityid
is defined as well.
- class qtealeaves.operators.TN4levelsOperators[source]
Operators defined for a 4-level system, e.g., targeting Rydberg systems with two low-energy states, one Rydberg state |r>, and one additional state |d> allowing a decay from |r> to |d>.
Arguments
- folder_operatorsstr, optional
The name of the subfolder inside the input folder, where we store operators. Default to
4levels
Details
The following operators are defined:
n0
,n1
,nr
,nd
,sx01
, andsx1r
. The identityid
is defined as well.
Bosonic operators
- class qtealeaves.operators.TNBosonicOperators[source]
Operators specifically targeted at bosonic systems. The operators
id
,b
,bdagger
,n
, andnint
are provided by default.Arguments
- folder_operatorsstr
The name of the subfolder inside the input folder, where we store operators.
Details
The truncation of the Fock-space can be set via the keys
fock_space_nmin
andfock_space_nmax
. By default, the local dimension is four including the levels 0, 1, 2, and 3.
Combined operators
- class qtealeaves.operators.TNCombinedOperators(ops_a, ops_b)[source]
Combine operators for system a and b.
Arguments
- ops_ainstance of
TNOperators
Set of operators for system a.
- ops_binstance of
TNOperators
Set of operators for system b.
- folder_operatorsstr, optional
The name of the subfolder inside the input folder, where we store operators. Default to
CombinedOps
Details
The key of the operators after merging will be ops_a.ops_b.
- ops_ainstance of